#ifndef WORLDSTATECONTAINERS_H_
#define WORLDSTATECONTAINERS_H_


struct InfluenceMap
{
private:
	int sizeX, sizeY;
	unsigned char** map;

public:
	InfluenceMap(int _x, int _y)
	{
		sizeX = _x;
		sizeY = _y;
		map = new unsigned char*[sizeX];
		for (int i = 0; i < sizeX; i++)
		{
			map[i] = new unsigned char[sizeY]();
		}
	}

	~InfluenceMap()
	{
		for (int i = 0; i < sizeX; i++)
		{
			delete map[i];
		}
		delete map;
	}

	int getSizeX(){ return sizeX; }
	int getSizeY(){ return sizeY; }
	float getAt(int _x, int _y)
	{
		if (_x >= sizeX || _y >= sizeY)
			return -1.0f;

		return (float)map[_x][_y] / 255;
	}

	float getAtUnchecked(int _x, int _y)
	{
		return (float)map[_x][_y] / 255;
	}

	void setAtUnchecked(int _x, int _y, unsigned char _value)
	{
		map[_x][_y] = _value;
	}

	unsigned char** getMap()
	{
		return map;
	}


};



#endif